﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IrrlichtLime;
using IrrlichtLime.Core;
using IrrlichtLime.Scene;

namespace BillardPHS4700 {
    /// <summary>
    /// Camera that looks at the white ball and the stick from the side
    /// //TODO implement this class
    /// </summary>
    class SideCamera : ICamera {

        SceneNode m_whiteBallRoot;

        public SideCamera(SceneNode whiteBallRoot) {
            m_whiteBallRoot = whiteBallRoot;
        }

        public void Initialize(CameraSceneNode node) {
            Node = node;
            node.Parent = m_whiteBallRoot;
            node.Position = new Vector3Df(-50, 0, 0);
            node.Target = m_whiteBallRoot.Position;
            node.UpVector = new Vector3Df(0, 0, 1);
        }

        public bool HandleEvent(Event eEvent) {
            //TODO implement
            return false;
        }

        public void Update() {
            Node.Target = m_whiteBallRoot.Position;
        }

        public CameraSceneNode Node { get; set; }
    }
}
